package cn.edu.uestc.software.controller;

import cn.edu.uestc.software.vo.JSONUser;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/11")
public class TestController {
    @RequestMapping("/test")
    public String test(){
        return "java test";
    }

    @RequestMapping("/check")
    public String check(){
        return "java check";
    }

    @RequestMapping("/param00")
    public String param00(){
        return "java param00";
    }

    @RequestMapping("/param01")
    public String param01(String username){
        System.out.println("username=" + username);
        return "java param01";
    }

    @RequestMapping("/param02")
    public String param02(String username,String password){
        System.out.println("username=" + username + "  " + "password=" + password);

        return "java param02";
    }

    @RequestMapping("/param03")
    public String param03(@RequestParam String username){

        System.out.println("username=" + username);
        return "java param03";
    }

    @RequestMapping(value = "/param04",method = RequestMethod.POST)
    public String param04(@RequestParam String username,@RequestParam String password){

        System.out.println("username=" + username + "  " + "password=" + password);
        return "java param04";
    }

    @RequestMapping("/param05")
    public String param05(String username,@RequestParam String password){

        System.out.println("username=" + username + "  " + "password=" + password);
        return "java param05";
    }

    @RequestMapping(value = "/json",method = RequestMethod.POST)
    public String json(@RequestBody JSONUser JsonUser){
        System.out.println("JsonUser.username = " + JsonUser.getUsername());
        return "java json JsonUser.username = " + JsonUser.getUsername();
    }
}
